package com.x.chalk.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.x.chalk.dto.MoodPageDto;
import com.x.chalk.entity.Mood;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author FSir
 * @create 2022/10/4 16:18
 */
public interface MoodDao extends BaseMapper<Mood> {
    List<MoodPageDto> moodpage(Integer page, Integer pageSize);

    long selectCount();

    MoodPageDto findMoodAndUser(int id);

    List<MoodPageDto> findMyMood(long uid);

    @Update("update t_mood set like_num = like_num+#{num}  where id=#{id}")
    int updateLikeNum(@Param("num") int num,@Param("id") Long id);

}
